

<div class="content" id="tabs">

    <div id="tabvanilla" class="widget">

        <ul class="tabnav">
            <li><a href="#information_tab"><?= lang('dtl.information'); ?></a></li>
            <li><a href="#prices_tab"><?= lang('dtl.prices_availability'); ?></a></li>
            <li><a href="#map_tab" id="do_google_map"><?= lang('dtl.map_distances'); ?></a></li>
            <?php if ($details->avg_reviews_score > 0): ?>
                    <li><a href="#reviews" id="view_reviews"><?= lang('dtl.reviews'); ?></a></li>
                <?php endif; ?>
            <li><a href="#question"><?= lang('dtl.question'); ?>?</a></li>
        </ul>

        <div id="information_tab" class="tabdiv ">


            <?php
                $person_s = $details->cur_room->room_max_person > 1 ? lang('res.persons') : lang('res.person');

                if ($this->lang->mci_current() == 'me'):

                    if ($details->cur_room->room_max_person == 1)
                        $person_s = lang('res.person');
                    else if ($details->cur_room->room_max_person >= 2 && $details->cur_room->room_max_person <= 4)
                        $person_s = lang('res.persone');
                    else
                        $person_s = lang('res.persons');

                endif;
            ?>



            <?php if ((isset($details->object_info) && ($details->object_info != "")) || ((isset($details->cur_room->room_info) && ($details->cur_room->room_info != "")))): ?>
                    <h3><?= $details->object_name ?></h3>
                    <div class="info">

                        <div class="detailbox" style="padding-top:0">

                            <dl class="clearfix">
                                <dt style="width:55px"><?= lang('dtl.room'); ?>:</dt>
                                <dd>
                                    <div class="maxps ps_<?= $details->cur_room->room_max_person ?>" title="<?= lang('form.for'); ?> <?= $details->cur_room->room_max_person ?> <?= $person_s ?>"></div>
                                    <?= lang('room.' . underscore($details->cur_room->room_type_name)); ?>  <span class="gray"><?= $details->cur_room->service_name ?></span>
                                    <?php if ($details->cur_room->room_description != "") echo '<br>' . $details->cur_room->room_description; ?>
                                </dd>
                            </dl>

                        </div>
                        <?= $details->cur_room->room_info ?>
                        <hr>
                    </div>

                <?php endif; ?>

            <div class = "description">

                <?php if (count($details->rooms) > 1): ?>

                        <h4><?= lang('other_accommodation_units'); ?>:</h4>

                    <?php endif; ?>

                <?php
                    if (!isset($_GET['preview'])) {

                        $build_G = $_GET;
                        if ($build_G['dest_hot'] == "")
                            $build_G['dest_hot'] = -1;

                        unset($build_G['lang']);

                        $build_GET = http_build_query($build_G);
                    }else {
                        $build_GET = '&preview=1';
                    }

                    $k = 0;
                    $none = "style='display:none'";
                ?>


                <div class="rooms">
                    <?php
                        foreach ($details->rooms as $room):
                            if ($room->room_ID != $details->cur_room->room_ID):

                                $href_room = lang_url('accommodation/' . $obj_name = URLify::filter($details->object_name) . '-' . $details->object_ID . '?' . $build_GET . '&room_id=' . $room->room_ID);

                                $k++;
                                ?>



                                <div class="other_rooms clearfix" <?= $k > 3 ? $none : '' ?>>

                                    <?php
                                    if (isset($room->photos[0])):
                                        $thumbnail = HOST_URL_HOTELS . $details->photo_path . '/rooms/' . $room->photos[0]->path . '/thumb_88x88/' . $room->photos[0]->photo_name;
                                        $photo_title = $room->photos[0]->photo_title;
                                    else:
                                        $thumbnail = $photo_title = "";
                                    endif;
                                    ?>



                                    <div class="table-holder">
                                        <a href="<?= $href_room ?>" class="slika">
                                            <img src="<?= $thumbnail ?>" alt="<?= $photo_title ?>">
                                        </a>
                                        <table class="table table-condensed table-hover rooms">
                                            <tbody>
                                                <tr>
                                                    <th><?= lang('res.accommodation'); ?></th>
                                                    <th><?= lang('res.service'); ?></th>
                                                    <th><?= lang('price'); ?></th>
                                                </tr>

                                                <tr>
                                                    <?php
                                                    $person_s = $room->room_max_person > 1 ? lang('res.persons') : lang('res.person');

                                                    if ($this->lang->mci_current() == 'me'):

                                                        if ($room->room_max_person == 1)
                                                            $person_s = lang('res.person');
                                                        else if ($room->room_max_person >= 2 && $room->room_max_person <= 4)
                                                            $person_s = lang('res.persone');
                                                        else
                                                            $person_s = lang('res.persons');

                                                    endif;
                                                    ?>
                                                    <td><a href="<?= $href_room ?>"><?= lang('room.' . underscore($room->room_type_name)); ?> <span class="gray"><?= $room->room_description ?></span>&nbsp;<?= lang('form.for'); ?> <?= $room->room_max_person ?> <?= $person_s ?></a></td>
                                                    <td class="gray"><?= $room->service_name ?></td>
                                                    <td class="price"><? if (!isset($_GET['preview'])) echo "<span>" . lang('from') . " </span>" . $room->selling_total . " €"; ?></td>
                                                </tr>


                                            </tbody>
                                        </table>
                                    </div>

                                </div>

                                <?php
                            endif;
                        endforeach;
                    ?>
                </div>

                <?php if ($k > 3): ?>
                        <div class="list_more">
                            <a href="javascript:" class="show_more more" data-id="more" data-elem=".rooms" data-find="div">+ <?= lang('more_rooms') ?> (<?= $k - 3 ?>)</a>
                            <a href="javascript:" class="show_more less" data-id="less" data-elem=".rooms" data-find="div" <?= $none ?>>- <?= lang('hide_rooms') ?> </a>
                        </div>
                    <?php endif; ?>

            </div>


            <?php if ((isset($details->object_info) && ($details->object_info != "")) || ((isset($details->cur_room->room_info) && ($details->cur_room->room_info != "")))): ?>

                    <div class="info">
                        <hr>
                        <h4><?= lang('description'); ?>:</h4>
                        <?= $details->object_info ?>
                    </div>

                <?php endif; ?>

            <div class="clearfix">
                <hr>
                <?php $this->load->view('parts/information_tab_facilities'); ?>

            </div>

            <div class = "description">
                <hr>
                <h4><?= lang('description'); ?>:</h4>
                <p><?= lang('one_time_registration_is'); ?> ( 5 - 10 €)</p>
            </div>

            <br>


        </div><!--/information_tab-->

        <div id = "prices_tab" class = "tabdiv clearfix" style="display: none">

            <div class = "pull-right polices">

                <?php if ((isset($details->object_cancellation) && $details->object_cancellation != '') || (isset($details->cur_room->room_cancellation) && $details->cur_room->room_cancellation != '')): ?>

                        <h4><?= lang('dtl.cancellation_policy'); ?></h4>

                        <?= $details->cur_room->room_cancellation ?>
                        <?= $details->object_cancellation ?>

                    <?php endif; ?>


                <?php if (isset($details->object_extra_bed) && $details->object_extra_bed != ''): ?>
                        <h4><?= lang('dtl.children_and_extra_beds'); ?></h4>

                        <?= $details->object_extra_bed ?>

                    <?php endif; ?>

                <h4><?= lang('dtl.payment_conditions'); ?></h4>
                <p><?= lang('dtl.payment_conditions_text'); ?></p>

            </div>

            <div class="pull-left oneborder">

                <form class="form-horizontal" id="prices_form" action="<?= lang_url('reservation') ?>" method="get">

                    <input type="hidden" name="hotel_id" id="hotel_id" value="<?= $_GET['hotel_id'] ?>">
                    <input type="hidden" name="room_id" value="<?= $_GET['room_id'] ?>">

                    <?php
                        $this->load->view('parts/pricesform', array(
                            'default_nr_person' => $details->object_type_ID == 2 ? 2 : 2,
                            'adults_person' => $details->object_type_ID == 2 ? 5 : 12,
                            'service_name' => $details->cur_room->service_name,
                            'service_price' => !isset($_GET['preview']) ? $details->cur_room->selling_total : '0',
                            'service_total' => !isset($_GET['preview']) ? $details->cur_room->total : '0',
                            'tax' => isset($details->tax) ? $details->tax : NULL
                        ))
                    ?>

                    <div class="clearfix">
                        <div class="hold_booknow">
                            <input type="submit" value="<?= $details->cur_room->room_selling_type_ID == 1 ? lang('res.send_request') : lang('res.book_now'); ?>" class="booknow <?= $details->cur_room->room_selling_type_ID == 1 ? "request" : ""; ?>" id="book_now_input_default">  
                        </div>
                    </div>

                </form>

            </div>

            <div style="clear:both"></div>

            <?php if ($priceListHTML != ""): ?>

                    <a id="priceList" class="link" href="javascript:"><?= lang('pricelist'); ?></a>

                    <div class="priceListTable">

                        <div class="service_info">

                            <?= $details->cur_room->service_name ?> - <?= lang('price_in') ?> Euro 
                            <?php
                            switch ($details->cur_room->room_selling_billing_type_ID) {

                                case 2:
                                    echo lang('per person/night');
                                    break;
                                case 3:
                                    echo
                                    lang('per item per day');
                                    break;
                                case 5:
                                    echo lang('per room/night');
                                    break;
                            }
                            ?>
                        </div>
                        <?= $priceListHTML ?>
                    </div>

                <?php endif; ?>


        </div><!--/prices_tab-->

        <div id="map_tab" class="tabdiv clearfix"  style="display: none">

            <div class="pull-right">

                <ul>
                    <li class="section"><?= lang('dtl.distances_from'); ?></li>
                    <?php
                        if (isset($distances_from) && count($distances_from) > 0):
                            $distancesFrom = explode(',', $distances_from);

                            foreach ($distancesFrom as $value) :

                                echo "<li>$value</li>";

                            endforeach;
                        endif;
                    ?>

                </ul>

            </div>

            <div class="pull-left">
                <div id="google_map"></div>
            </div>


        </div><!--map_tab-->

        <div id="reviews" class="tabdiv clearfix"  style="display: none">

            <div  id="hotels-placeholder">
                <div  id="hotel-reviews">

                    <?php $this->load->view('parts/reviews') ?>

                </div>
            </div>

        </div>

        <div id="question" class="tabdiv clearfix"  style="display: none">

            <form id="question_form">
                <input type="hidden" name="from_page" value="<?= $details->object_name ?>">
                <fieldset>
                    <legend><?= lang('dtl.question'); ?>?</legend>

                    <p></p>
                    <p class="help-block"><?= lang('dtl.question_text'); ?></p>

                    <div class="pull-left col-1">

                        <label><?= lang('name'); ?>:</label>
                        <input type="text" placeholder="<?= lang('name') ?>" name='name' id='name' required>

                        <label><?= lang('surname'); ?>:</label>
                        <input type="text" placeholder="<?= lang('surname') ?>" name='surname' id='surname' required>

                        <label><?= lang('country'); ?>:</label>
                        <select placeholder="<?= lang('country'); ?>" name="country" id="country" required>
                            <option value=""><?= lang('country'); ?></option>
                            <?php
                                foreach (config_item('country_list') as $key => $country)
                                    echo "<option value='{$country}'>{$country}</option>";
                            ?>
                        </select>

                        <label><?= lang('email'); ?>:</label>
                        <input type="email" placeholder="<?= lang('email') ?>"  name='email' id='email' required>

                        <label><?= lang('mobile_phone'); ?>:</label>
                        <input type="text" placeholder="<?= lang('mobile_phone') ?>"  name='mobile_phone' id='mobile_phone' required>

                        <label class="checkbox">
                            <input type="checkbox" checked="checked" value='1' name='newsletter'><span class="help-block"><?= lang('newsletter'); ?></span>
                        </label>

                    </div>
                    <div class="pull-left col-2">

                        <label><?= lang('note'); ?>:</label>
                        <textarea cols="33" rows="8" name='note' id='note' required></textarea>

                        <button type="submit" class="button-home"><?= lang('send'); ?></button>

                    </div>
                </fieldset>
            </form>
            <br>

        </div><!--question_tab-->

    </div>

</div>